const express = require('express');
const cors = require('cors');
const { createProxyMiddleware } = require('http-proxy-middleware');

const app = express();
app.use(cors());

app.use('/api/movie', createProxyMiddleware({
  target: 'http://api.maoyan.com',
  changeOrigin: true,
  pathRewrite: {
    '^/api/movie': ''
  }
}));

app.listen(3000); 